package com.ruoyi.hospital.service.hospital.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.hospital.HisDepartmentMapper;
import com.ruoyi.hospital.domain.hospital.HisDepartment;
import com.ruoyi.hospital.service.hospital.IHisDepartmentService;

/**
 * 医院科室Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-08-13
 */
@Service
public class HisDepartmentServiceImpl implements IHisDepartmentService 
{
    @Autowired
    private HisDepartmentMapper hisDepartmentMapper;

    /**
     * 查询医院科室
     * 
     * @param id 医院科室主键
     * @return 医院科室
     */
    @Override
    public HisDepartment selectHisDepartmentById(Integer id)
    {
        return hisDepartmentMapper.selectHisDepartmentById(id);
    }

    /**
     * 查询医院科室列表
     * 
     * @param hisDepartment 医院科室
     * @return 医院科室
     */
    @Override
    public List<HisDepartment> selectHisDepartmentList(HisDepartment hisDepartment)
    {
        return hisDepartmentMapper.selectHisDepartmentList(hisDepartment);
    }

    /**
     * 新增医院科室
     * 
     * @param hisDepartment 医院科室
     * @return 结果
     */
    @Override
    public int insertHisDepartment(HisDepartment hisDepartment)
    {
        hisDepartment.setCreateTime(DateUtils.getNowTimeSecond());
        return hisDepartmentMapper.insertHisDepartment(hisDepartment);
    }

    /**
     * 修改医院科室
     * 
     * @param hisDepartment 医院科室
     * @return 结果
     */
    @Override
    public int updateHisDepartment(HisDepartment hisDepartment)
    {
        hisDepartment.setUpdateTime(DateUtils.getNowTimeSecond());
        return hisDepartmentMapper.updateHisDepartment(hisDepartment);
    }

    /**
     * 批量删除医院科室
     * 
     * @param ids 需要删除的医院科室主键
     * @return 结果
     */
    @Override
    public int deleteHisDepartmentByIds(Integer[] ids)
    {
        return hisDepartmentMapper.deleteHisDepartmentByIds(ids);
    }

    /**
     * 删除医院科室信息
     * 
     * @param id 医院科室主键
     * @return 结果
     */
    @Override
    public int deleteHisDepartmentById(Integer id)
    {
        return hisDepartmentMapper.deleteHisDepartmentById(id);
    }
}
